//
//  KDWorkingReportController.m
//  WangJingApp
//
//  Created by 魏强 on 17/11/2.
//  Copyright © 2017年 KDTech. All rights reserved.
//

#import "KDWorkingReportController.h"
#import "KDChildWorkingReportController.h"
#import "KDTabBarController.h"
#import "KDBaseChildNewsController.h"

@interface KDWorkingReportController ()
/**
 *  所有主题数据的集合
 */
@property (nonatomic, strong) NSArray * themeArr;
@end

@implementation KDWorkingReportController
#pragma mark - 懒加载区
#pragma mark - 懒加载区
- (NSArray *)themeArr
{
    if (!_themeArr) {
        _themeArr = @[@"全部", @"日报",@"周报",@"月报",@"年报"];
//        NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"FakeSubType" ofType:@"plist"];
        
        //    NSArray *data = [[NSArray alloc] initWithContentsOfFile:plistPath];
//        _themeArr = [KDSubscribTypeModel objectArrayWithFile:plistPath];
    }
    return _themeArr;
}
#pragma mark - 生命周期区
- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupNavBar];
    [self setupAllChildViewController];
    // Do any additional setup after loading the view.
}
#pragma mark - 板块布置区
- (void)setupNavBar{
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"leftArrow"] style:UIBarButtonItemStylePlain target:self action:@selector(leftItemClick)];
    
}
- (void)setupAllChildViewController{
    if (self.childViewControllers.count) {
        for (UIViewController *child in self.childViewControllers) {
            //            KDLog(@"%@",child.title);
            [child removeFromParentViewController];
            [child.view removeFromSuperview];
        }
        //        self.roleValue = 0;
    }
    NSInteger i= 0;
    for (NSString *title in self.themeArr) {
        //        if ([model.isChecked  isEqual: @"1"]) {
        KDChildWorkingReportController *child = [[KDChildWorkingReportController alloc]init];
        child.title = title;
        //            child.view.backgroundColor = RandomColor;
        child.type = i;
        [self addChildViewController:child];
        i++;
    }
    // 4.设置所有标题
    self.needUnderLine = YES;
    [super setupAllTitle];
}

#pragma mark - 事件点击区
- (void)leftItemClick{
    [self dismissViewControllerAnimated:YES completion:nil];
}
#pragma mark - 网络请求区

#pragma mark - 通知接收区


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
